<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .box {
      width: 120px;
      height: 40px;
      background-color: pink;
      /* 1.不允许文字换行，强制一行显示 */
      white-space: nowrap;
      /* 2.溢出吟唱 */
      overflow: hidden;
      /* 3.省略号显示 */
      text-overflow: ellipsis;

    }
  </style>
</head>

<body>
  <div class="box">这里有很多很多的文字</div>
</body>

</html>